﻿#region File Header

/* File Name    : UserManager.cs
 * Description  : Contains methods to retrieve user details
 * Log
 * Date             Author              Description
 * 19-Oct-2011      Robin Jome          Class is created
 */

#endregion

#region Namespaces

using System.Collections.Generic;
using FacebookAPI.Base;
using FacebookAPI.FacebookProperties;
using FacebookAPI.Objects;

#endregion

namespace FacebookAPI.Managers
{
    #region Class

    /// <summary>
    /// Contains methods to retrieve user details
    /// </summary>
    public class FacebookUserManager
    {
        #region Member Fields

        FacebookManager facebookManager = new FacebookManager();

        #endregion

        #region Methods

        #region Basic CRUD operations

        public FBObject GetUserDetails<FBObject>(string userId, FilterOptions filterOptions, string accessToken)
            where FBObject : class
        {
            return facebookManager.GetData<FBObject>(
                new FacebookRequest(userId, filterOptions, accessToken));
        }

        #endregion

        #region Edges

        public FacebookList<Account> GetAccounts(string userId, FilterOptions filterOptions, string accessToken)
        {
            return facebookManager.GetData<FacebookList<Account>>(
                new FacebookRequest(userId, "accounts", filterOptions, accessToken));
        }

        public FacebookList<Activity> GetActivities(string userId, FilterOptions filterOptions, string accessToken)
        {
            return facebookManager.GetData<FacebookList<Activity>>(
                new FacebookRequest(userId, "activities", filterOptions, accessToken));
        }

        public FacebookList<FriendList> GetFriendLists(string userId, FilterOptions filterOptions, string accessToken)
        {
            return facebookManager.GetData<FacebookList<FriendList>>(
                new FacebookRequest(userId, "friendlists", filterOptions, accessToken));
        }

        public FacebookList<Album> GetAlbums(string userId, FilterOptions filterOptions, string accessToken)
        {
            return facebookManager.GetData<FacebookList<Album>>(
                new FacebookRequest(userId, "albums", filterOptions, accessToken));
        }

        public FacebookList<FacebookEvent> GetFacebookEvents(string userId,
            FilterOptions filterOptions, string accessToken)
        {
            return facebookManager.GetData<FacebookList<FacebookEvent>>(
                new FacebookRequest(userId, "event", accessToken));
        }

        public FacebookList<Achievement> GetAchievements(string userId, FilterOptions filterOptions,
            string accessToken)
        {
            return facebookManager.GetData<FacebookList<Achievement>>(
                new FacebookRequest(userId, "achievements", filterOptions, accessToken));
        }

        #endregion

        #endregion
    }

    #endregion
}
